/**
 * 
 */
package org.swing.utility.system.conts;

import java.util.Map;

/**
 * @author lqnhu
 *
 */

public final class Attribute<T> {
	public static <T> Attribute<T> named(String name) {
		return new Attribute<T>(name);
	}

	private final String name;

	private Attribute(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return name;
	}

	public Map.Entry<String, T> toEntry() {
		return new Map.Entry<String, T>() {
			public String getKey() {
				return name;
			}

			public T getValue() {
				return null;
			}

			public T setValue(T value) {
				throw new UnsupportedOperationException();
			}
		};
	}
}
